/*
 * This is the Model Controller to Model INTERFACE
 */
package model;

import java.net.InetAddress;
import java.nio.file.Path;
import java.util.ArrayList;

/**
 *
 * @author Nana
 */
public interface ChatModelCtrlr2Model {

    /**
     * Sets the local user name
     *
     * @param username the username
     */
    public void setUsername(String username);

    /**
     * Gets the local user name
     *
     * @return the local username
     */
    public String getUsername();

    /**
     * Sets the remote user name
     *
     * @param netUsername The remote user name
     */
    public void setNetUsername(String netUsername);

    /**
     * Gets the remote user name
     *
     * @return the net username (ex : gabriel@192.168.1.1)
     */
    public String getNetUsername();

    /**
     * Sets the broadcast IP address
     *
     * @param broadcastIp The broadcast IP address
     */
    public void setBroadcastIpAddress(InetAddress broadcastIp);

    /**
     * Gets the broadcast IP address
     *
     * @return the broadcast ip address
     */
    public InetAddress getBroadcastIpAddress();

    /**
     * Adds a remote user to the connected user list
     *
     * @param netUsername The remote user name
     * @return whether the user has been added or not
     */
    public boolean addUserToList(String netUsername);

    /**
     * Deletes a remote user to the connected user list
     *
     * @param netRemoteUsername The remote user name
     * @return whether the user has been deleted or not
     */
    public boolean delUserFromList(String netRemoteUsername);

    /**
     * Add to the Chat Messages a new text message that has been received.
     * Updates the observers.
     *
     * @param message The received message
     * @param from The remote user name
     * @param to The list of receivers
     */
    public void addReceivedTextMessage(String message, String from, ArrayList<String> to);

    /**
     * Add to the Chat Messages a new text message that has been sent. Updates
     * the observers.
     *
     * @param message The message to send
     * @param to The list of receivers
     */
    public void addSentTextMessage(String message, ArrayList<String> to);

    /**
     * Add to the Chat Messages a new text message to notify that a file has
     * been received. Updates the observers.
     *
     * @param filename The name of the file
     * @param from The name of the sender
     * @param to The list of receivers
     * @param boolReceived Indicates the state of the reception
     */
    public void addTextNotifyFileReceived(String filename, String from, ArrayList<String> to, boolean boolReceived);

    /**
     * Add to the Chat Messages a new text message to notify that a file has
     * been sent. Updates the observers.
     *
     * @param filename The name of the file
     * @param remoteUsername The remote user name
     * @param boolTransmitted The state of the transmissino
     */
    public void addTextNotifyFileTransmitted(String filename, String remoteUsername, boolean boolTransmitted);

    /**
     * Creates a sent file proposal Sends the file proposal
     *
     * @param fileName The name of the file
     * @param filePath The path of the file
     * @param curRmUser The name of the remote user
     */
    public void rememberFileProposal(String fileName, Path filePath, String curRmUser);

    /**
     * Gets the path of a file to send
     *
     * @param fileName The name of the file
     * @param remoteNetname The remote user name
     * @return the file path associated to the proposal filename/remoteNetname
     */
    public Path getFilePathForProposal(String fileName, String remoteNetname);

    /**
     * Forget a file proposal after it has done its job Deletes the file
     * proposal from the file proposal list
     *
     * @param fileName The name of the file
     * @param remoteNetname The remote user name
     */
    public void forgetFileProposal(String fileName, String remoteNetname);

    /**
     * Clears the list of the connected user list Used when the local user
     * disconnects
     */
    public void emptyConnectedUsersList();
}
